<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function New(func){
				let res={};
				if(func.prototype!==null){
					res.__proto__=func.prototype;
				}
				let ret=func.apply(res,Array.prototype.slice.call(arguments,1));
				if(typeof ret==='object' || typeof ret==='function'&&ret!==null){
					return ret;
				}
				return res;
			}
			let pbj=New(a,1,2,3);
			console.log(pbj);
			function a(){}
		</script>
	</body>
</html>
